import request from '@/utils/request'

//合计数据
export function dataBill(query) {
  return request({
    url: '/recovery/bill/list/sum',
    method: 'get',
    params: query
  })
}

// 查询财务账单列表
export function listBill(query) {
  return request({
    url: '/recovery/bill/list',
    method: 'get',
    params: query
  })
}

export function sellListBill(query) {
  return request({
    url: '/recovery/bill/sell/list',
    method: 'get',
    params: query
  })
}

// 查询财务账单详细
export function getBill(billId) {
  return request({
    url: '/recovery/bill/' + billId,
    method: 'get'
  })
}

// 新增财务账单
export function addBill(data) {
  return request({
    url: '/recovery/bill',
    method: 'post',
    data: data
  })
}

// 修改财务账单
export function updateBill(data) {
  return request({
    url: '/recovery/bill',
    method: 'put',
    data: data
  })
}

// 删除财务账单
export function delBill(billId) {
  return request({
    url: '/recovery/bill/' + billId,
    method: 'delete'
  })
}

// 批量审核
export function updateStatus(billId) {
  return request({
    url: '/recovery/bill/status/' + billId,
    method: 'put'
  })
}

// 导出财务账单
export function exportBill(query) {
  return request({
    url: '/recovery/bill/export',
    method: 'get',
    params: query
  })
}

export function insertListBill(data) {
  return request({
    url: '/recovery/bill/add/list',
    method: 'post',
    data: data
  })
}

export function outGoodsBill(data) {
  return request({
    url: '/recovery/bill/out/goods',
    method: 'post',
    data: data
  })
}
/* 支付方式统计*/
export function conditionSearch(data) {
  return request({
    url: '/recovery/bill/condition',
    method: 'post',
    data: data
  })
}
